class Singleton{
    private static volatile Singleton instance = null ;
    private static Object lock = new Object();
    public static Singleton getInstance(){
        if(instance == null){
            synchronized(lock){
                if(instance == null){
                    instance = new Singleton();
                }
            }
        }
        return instance;
    }
    public Singleton(){

    }

}

public class Test4 {
    public static void main(String[] args) {


    }
}
